<template>
  <div>
    <p>{{ count }}</p>
    <p>{{ name | nameHandle('风','残') }}</p>
    <button @click="increment">累加</button>
    <button @click="showCount">查看</button>
    <button @click="fullName">将Vue原型的属性拿到</button>
  </div>
</template>

<script>
export default {
  name: "Count",
  props: ["count", "increment"],
  data() {
    return {
      name: "晓",
    };
  },
  methods: {
    showCount() {
      //打印父组件传过来的方法与属性
      console.log(this.count, this.increment);
    },
    fullName() {
      //通过隐式原型访问Vue原型对象
      this.name = this.name + this.__proto__.__proto__.num;
    },
  },
  filters: {
    //创建过滤器
    nameHandle(value,f,c) {
      return "曾经我叫"+value+f+c
    },
  },
};
</script>

<style>
</style>